import React, { Component } from 'react'

export default class Child extends Component {
    state = {
        // studentList: [
        //     { id: "1", name: "tom", age: "18" },
        //     { id: "2", name: "jack", age: "19" },
        //     { id: "3", name: "tony", age: "20" },
        // ]
        studentList:"afsd"
    }
    render() {
        const { studentList } = this.state;
        return (
            <div>
                <h1>我是 Child 组件</h1>
                <ul>
                    {
                        studentList.map(item => {
                            return <li key={item.id}>{item.name}---{item.age}</li>
                        })
                    }
                </ul>
            </div>
        )
    }
}
